import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 回收品牌信息 */
export interface Brand {
          brandName?: string; // 品牌名称
          categoryId?: number; // 所属品类ID
          brandLogo: string; // 品牌logo
          status: number; // 状态
          sort: number; // 排序值
  }

// 回收品牌 API
export const BrandApi = {
  // 查询回收品牌分页
  getBrandPage: async (params: any) => {
    return await request.get({ url: `/recycling/brand/page`, params })
  },

  // 查询回收品牌详情
  getBrand: async (id: number) => {
    return await request.get({ url: `/recycling/brand/get?id=` + id })
  },

  // 新增回收品牌
  createBrand: async (data: Brand) => {
    return await request.post({ url: `/recycling/brand/create`, data })
  },

  // 修改回收品牌
  updateBrand: async (data: Brand) => {
    return await request.put({ url: `/recycling/brand/update`, data })
  },

  // 删除回收品牌
  deleteBrand: async (id: number) => {
    return await request.delete({ url: `/recycling/brand/delete?id=` + id })
  },

  /** 批量删除回收品牌 */
  deleteBrandList: async (ids: number[]) => {
    return await request.delete({ url: `/recycling/brand/delete-list?ids=${ids.join(',')}` })
  },

  // 导出回收品牌 Excel
  exportBrand: async (params) => {
    return await request.download({ url: `/recycling/brand/export-excel`, params })
  },
}